package com.easyjava.bean;

import com.easyjava.utils.PropertiesUitls;

/**
 * @ClassName Constants
 * @Date 2024/5/29  17:15
 **/
public class Constants {

    public static Boolean IGNORE_TABLE_PREFIX;

    public static String SUFFIX_BEAN_QUERY;

    public static String PATH_JAVA = "java";

    public static String PATH_RESOURCES = "resources";


    public static String PATH_BASE;

    public static String PATH_BASE_JAVA;

    public static String PATH_PO;

    public static String PACKAGE_BASE;


    public static String PACKAGE_PO;

    public static String AUTHOR_COMMENT;

    public static String IGNORE_JSON_FIELD;
    public static String IGNORE_JSON_EXPRESSION;
    public static String IGNORE_JSON_CLASS;
    public static String DATE_SERIALIZE_EXPRESSION;
    public static String DATE_SERIALIZE_CLASS;
    public static String DATE_DESERIALIZE_EXPRESSION;
    public static String DATE_DESERIALIZE_CLASS;

    public static String PACKAGE_UTILS;

    public static String PATH_UTILS;

    public static String PACKAGE_ENUMS;

    public static String PATH_ENUMS;

    public static String PACKAGE_QUERY;

    public static String PATH_QUERY;

    public static String PACKAGE_MAPPER;

    public static String PATH_MAPPER;

    public static String PATH_MAPPER_XML;

    public static String PACKAGE_SERVICE;
    public static String PACKAGE_SERVICE_IMPL;

    public static String PATH_SERVICE;

    public static String PATH_SERVICE_IMPL;

    public static String PACKAGE_VO;

    public static String PATH_VO;

    public static String PACKAGE_EXCEPTION;

    public static String PATH_EXCEPTION;

    public static String PACKAGE_CONTROLLER;

    public static String PATH_CONTROLLER;


    public static String SUFFIX_QUERY_FUZZY;

    public static String SUFFIX_QUERY_TIME_START;

    public static String SUFFIX_QUERY_TIME_END;

    public static String SUFFIX_MAPPER;

    public static String SUFFIX_SERVICE;

    public static String SUFFIX_SERVICE_IMPL;



    static {
        IGNORE_TABLE_PREFIX = Boolean.valueOf(PropertiesUitls.getString("ignore.table.prefix"));
        SUFFIX_BEAN_QUERY = PropertiesUitls.getString("suffix.bean.query");
        PACKAGE_BASE = PropertiesUitls.getString("package.base");

        PATH_BASE = PropertiesUitls.getString("path.base");
        PACKAGE_PO = PACKAGE_BASE + "." + PropertiesUitls.getString("package.po");
        PATH_BASE_JAVA = PATH_BASE + PATH_JAVA;

        PATH_PO = PATH_BASE_JAVA + "/" + PACKAGE_PO.replace(".", "/");

        PACKAGE_UTILS = PACKAGE_BASE + "." + PropertiesUitls.getString("package.utils");
        PATH_UTILS = PATH_BASE_JAVA + "/" + PACKAGE_UTILS.replace(".", "/");

        PACKAGE_ENUMS = PACKAGE_BASE +"." + PropertiesUitls.getString("package.enums");
        PATH_ENUMS = PATH_BASE_JAVA + "/" + PACKAGE_ENUMS.replace(".", "/");

        PACKAGE_QUERY = PACKAGE_BASE + "." + PropertiesUitls.getString("package.query");
        PATH_QUERY = PATH_BASE_JAVA + "/" + PACKAGE_QUERY.replace(".", "/");

        PACKAGE_VO = PACKAGE_BASE + "." + PropertiesUitls.getString("package.vo");
        PATH_VO = PATH_BASE_JAVA  + "/" + PACKAGE_VO.replace(".","/");

        PACKAGE_MAPPER = PACKAGE_BASE + "." + PropertiesUitls.getString("package.mapper");
        PATH_MAPPER = PATH_BASE_JAVA + "/" + PACKAGE_MAPPER.replace(".", "/");

        SUFFIX_QUERY_FUZZY = PropertiesUitls.getString("suffix.bean.query.fuzzy");

        SUFFIX_QUERY_TIME_START = PropertiesUitls.getString("suffix.bean.query.time.start");
        SUFFIX_QUERY_TIME_END = PropertiesUitls.getString("suffix.bean.query.time.end");

        SUFFIX_MAPPER = PropertiesUitls.getString("suffix.mapper");


        PATH_MAPPER_XML = PATH_BASE + PATH_RESOURCES + "/" + PropertiesUitls.getString("package.mapper");

        PACKAGE_SERVICE =PACKAGE_BASE + "." + PropertiesUitls.getString("package.service");
        PATH_SERVICE = PATH_BASE_JAVA + "/" + PACKAGE_SERVICE.replace(".", "/");
        SUFFIX_SERVICE = PropertiesUitls.getString("suffix.service");

        PACKAGE_SERVICE_IMPL = PACKAGE_BASE + "." + PropertiesUitls.getString("package.service.impl");
        PATH_SERVICE_IMPL = PATH_BASE_JAVA + "/" + PACKAGE_SERVICE_IMPL.replace(".", "/");

        PACKAGE_EXCEPTION = PACKAGE_BASE + "." + PropertiesUitls.getString("package.exception");
        PATH_EXCEPTION = PATH_BASE_JAVA + "/" + PACKAGE_EXCEPTION.replace(".", "/");


        PACKAGE_CONTROLLER = PACKAGE_BASE + "." + PropertiesUitls.getString("package.controller");
        PATH_CONTROLLER =  PATH_BASE_JAVA + "/" + PACKAGE_CONTROLLER.replace(".", "/");

        SUFFIX_SERVICE_IMPL = PropertiesUitls.getString("suffix.service.impl");


        AUTHOR_COMMENT = PropertiesUitls.getString("author.comment");


        IGNORE_JSON_FIELD = PropertiesUitls.getString("ignore.json.field");
        IGNORE_JSON_EXPRESSION = PropertiesUitls.getString("ignore.json.expression");
        IGNORE_JSON_CLASS = PropertiesUitls.getString("ignore.json.class");
        DATE_SERIALIZE_EXPRESSION = PropertiesUitls.getString("date.serialize.expression");
        DATE_SERIALIZE_CLASS = PropertiesUitls.getString("date.serialize.class");
        DATE_DESERIALIZE_EXPRESSION = PropertiesUitls.getString("date.deserialize.expression");
        DATE_DESERIALIZE_CLASS = PropertiesUitls.getString("date.deserialize.class");

    }

    public static String[] SQL_DATE_TIME_TYPE = new String[]{"datetime", "timestamp"};

    public static String[] SQL_DATE_TYPE = new String[]{"date"};


    public static final String[] SQL_DECIMAL_TYPE = new String[]{"decimal", "double", "float"};

    public static final String[] SQL_STRING_TYPE = new String[]{"char", "varchar", "text", "mediumtext"};

    public static final String[] SQL_INTEGER_TYPE = new String[]{"int", "tinyint"};

    public static final String[] SQL_LONG_TYPE = new String[]{"bigint"};


    public static void main(String[] args) {
        System.out.println(PATH_BASE);
        System.out.println(PATH_BASE_JAVA);
        System.out.println(PACKAGE_BASE);
        System.out.println(PACKAGE_PO);
        System.out.println(PATH_PO);
        System.out.println(PACKAGE_UTILS);
        System.out.println(PACKAGE_QUERY);
        System.out.println(PACKAGE_MAPPER);
        System.out.println(PATH_MAPPER_XML);
        System.out.println(PACKAGE_SERVICE);
        System.out.println(PATH_SERVICE);
        System.out.println(PACKAGE_SERVICE_IMPL);
        System.out.println(PATH_SERVICE_IMPL);
        System.out.println(PACKAGE_VO);
    }
}
